package com.seeyon.apps.ddkk.manager;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.seeyon.apps.collaboration.po.ColSummary;
import com.seeyon.cap4.form.bean.FormBean;
import com.seeyon.cap4.form.bean.FormDataMasterBean;
import com.seeyon.ctp.common.exceptions.BusinessException;
import com.seeyon.ctp.organization.bo.V3xOrgMember;
import com.seeyon.oainterface.impl.V3xManagerFactory;

public interface QiangsDDManager {

	
	/**
	 * 表单关联
	 * @param sourceBean 源表单
	 * @param sourceDataBean 源表单
	 * @param targetCode 关联到的表单模版编号数
	 * @param targetMasterId 关联到的表单数据ID(底表为formmain_****数据ID\关联协同则为colsummary的ID)
	 * @throws BusinessException
	 */
	public void createFormRelation(FormBean sourceBean, FormDataMasterBean sourceDataBean, 
			String targetCode, Long targetMasterId) throws BusinessException, SQLException;
	
	/**
	 * 修改关键人员底表的信息
	 * @param masterId
	 * @param name
	 */
	public String updateKeyMemberInfo(int type, String masterId, String name, String formId);
	
	/**
	 * 节点自动处理
	 */
	public void dealFormNode();
		/**
	 * 经销商账号邮件重发
	 * @param userIds
	 * @return
	 */
	public String resendMail(String userIds);
	
	/**
	 * 发送经销商账号邮件
	 * @param list
	 * @param member
	 * @return
	 * @throws BusinessException
	 */
	public boolean sendMail(List<String> list, String ddMail, Date endDate, V3xOrgMember member) throws BusinessException;
	
	/**
	 * 获取流程对应的关键人员底表数据
	 * @param formBean
	 * @param formDataBean
	 * @return 
	 * @throws BusinessException
	 * @throws SQLException
	 */
	public Map<Long ,FormDataMasterBean> findRelationKeyMember(FormBean formBean, FormDataMasterBean formDataBean) throws BusinessException, SQLException;
	
	/**
	 * DD renew 判断发起条件、创建经销商账号、DD排班、邮件推送及生成关键人员
	 * @param formBean
	 * @param formDataMasterBean
	 * @return
	 */
	public String renewSendValidt(FormBean formBean, FormDataMasterBean formDataMasterBean);
	
	/**
	 * 红色预警校验
	 * @param formBean
	 * @param formDataMasterBean
	 * @return
	 */
	//public boolean validatRedWarn(FormBean formBean, FormDataMasterBean formDataMasterBean);
	
	/**
	 * 获取企信宝定制报告
	 */
	public void findReport();
}
